import os

def find_repo(path):
    while not os.path.isdir(os.path.join(path, '.ss')):
        path, old_path = os.path.dirname(path), path
        if path == old_path:
            return None
    return path
